package cn.hill4j.tool.spring.std.ds.customer.service.impl;

import cn.hill4j.tool.spring.std.ds.customer.entity.Customer;
import cn.hill4j.tool.spring.std.ds.customer.mapper.CustomerMapper;
import cn.hill4j.tool.spring.std.ds.customer.service.ICustomerService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * TODO Description
 *
 * @author: hillchen
 * Date: 2022-08-08 16:04
 */
@Service
@DS("ds2")
public class CustomerService extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService {
    @Override
    @Transactional
    public void saveByName(String name) {
        Customer customer = new Customer();
        customer.setName(name);
        save(customer);
    }
}
